/*
 * @Descripttion: 
 * @version: 
 * @Author: 
 * @Date: 2019-10-11 10:14:07
 */
import https from "../http";
import qs from "qs";
const TZD_API = process.env.NODE_ENV == "development" ? "/tzdUrl" : `${process.env.JZT_API}`;
const JZT_API = process.env.NODE_ENV == "development" ? "/jztUrl" : `${process.env.JZT_API}`;
const WSB_API = process.env.NODE_ENV == "development" ? "/wsbUrl" : `${process.env.JZT_API}`;

const metadataRegistrationApi = {
  //  元数据注册tree信息
  treeData: function (query) {
    return https({
      url: `${JZT_API}/MetaDataRegister/findCata`,
      method: 'get',
      headers: {
        sendKey: "treeData"
      },
      params: query
    })
  },
  //  查询所有父级系统
  findAllSys: function (query) {
    return https({
      url: `${JZT_API}/MetaDataRegister/findAllSys`,
      method: 'get',
      headers: {
        sendKey: "findAllSys"
      },
      params: query
    })
  },
  //  查询下拉框信息
  exchangeSystem: function (query) {
    return https({
      url: `${WSB_API}/dict/queryDictInfoByType`,
      method: 'get',
      headers: {
        sendKey: "ExchangeSystem"
      },
      params: query
    })
  },
  //  建设部门，使用部门
  findOrgCatalogTree: function (query) {
    return https({
      url: `${WSB_API}/catalog/findOrgCatalogTree`,
      method: 'get',
      headers: {
        sendKey: "findOrgCatalogTree"
      },
      params: query
    })
  },
  //  标签管理
  queryLabelTree: function (query) {
    return https({
      url: `${WSB_API}/label/queryLabelTree`,
      method: 'get',
      headers: {
        sendKey: "queryLabelTree"
      },
      params: query
    })
  },
  //  汇交方式
  getQueryDictInfoByType: function (query) {
    return https({
      url: `${WSB_API}/dict/queryDictInfoByType`,
      method: 'get',
      headers: {
        sendKey: "getQueryDictInfoByType"
      },
      params: query
    })
  },
  //  所属数据库
  findAllSql: function (query) {
    return https({
      url: `${JZT_API}/MetaDataRegister/findAllSql`,
      method: 'get',
      headers: {
        sendKey: "findAllSql"
      },
      params: query
    })
  },
  //  根据所属数据库查询所属系统
  findSysByDbId: function (query) {
    return https({
      url: `${JZT_API}/MetaDataRegister/findSysByDbId`,
      method: 'get',
      headers: {
        sendKey: "findSysByDbId"
      },
      params: query
    })
  },
  //  数据采集策略
  AcquisitionStrategy: function (query) {
    return https({
      url: `${WSB_API}/dict/queryDictInfoByType`,
      method: 'get',
      headers: {
        sendKey: "AcquisitionStrategy"
      },
      params: query
    })
  },
  //  数据公开方式
  DataDisclosureMethod: function (query) {
    return https({
      url: `${WSB_API}/dict/queryDictInfoByType`,
      method: 'get',
      headers: {
        sendKey: "DataDisclosureMethod"
      },
      params: query
    })
  },
  //  数据储存策略
  DataStorageStrategy: function (query) {
    return https({
      url: `${WSB_API}/dict/queryDictInfoByType`,
      method: 'get',
      headers: {
        sendKey: "DataStorageStrategy"
      },
      params: query
    })
  },
  //  表类型
  TableType: function (query) {
    return https({
      url: `${WSB_API}/dict/queryDictInfoByType`,
      method: 'get',
      headers: {
        sendKey: "TableType"
      },
      params: query
    })
  },
  //  初步类型
  PreliminaryType: function (query) {
    return https({
      url: `${WSB_API}/dict/queryDictInfoByType`,
      method: 'get',
      headers: {
        sendKey: "PreliminaryType"
      },
      params: query
    })
  },
  //  业务流程
  BusinessProcess: function (data) {
    return https({
      url: `${TZD_API}/BusinessProcess/findCata`,
      method: 'post',
      headers: {
        sendKey: "BusinessProcess"
      },
      data: data
    })
  },
  //  流程节点
  ProcessNode: function (data) {
    return https({
      url: `${TZD_API}/BusinessProcessNode/findCataByVersionId`,
      method: 'post',
      headers: {
        sendKey: "ProcessNode"
      },
      params: data
    })
  },
  //  业务规则
  BusinessRules: function (data) {
    return https({
      url: `${TZD_API}/BusinessRule/findCata`,
      method: 'post',
      headers: {
        sendKey: "BusinessRules"
      },
      data: data
    })
  },
  //  系统元数据注册
  insertSystem: function (data) {
    return https({
      url: `${JZT_API}/MetaDataRegister/insertSystem`,
      method: 'post',
      headers: {
        sendKey: "insertSystem"
      },
      data: data
    })
  },
  //  数据库元数据注册
  insertSql: function (data) {
    return https({
      url: `${JZT_API}/MetaDataRegister/insertSql`,
      method: 'post',
      headers: {
        sendKey: "insertSql"
      },
      data: data
    })
  },
  //  表元数据注册
  insertTable: function (data) {
    return https({
      url: `${JZT_API}/MetaDataRegister/insertTable`,
      method: 'post',
      headers: {
        sendKey: "insertTable"
      },
      data: data
    })
  },
  //  查询所有的接口服务器
  findAllInterfaceServer: function (data) {
    return https({
      url: `${JZT_API}/MetaDataRegister/findAllInterfaceServer`,
      method: 'get',
      headers: {
        sendKey: "findAllInterfaceServer"
      },
      params: data
    })
  },
  //  查询所有接口类型
  InterfaceType: function (data) {
    return https({
      url: `${WSB_API}/dict/queryDictInfoByType`,
      method: 'get',
      headers: {
        sendKey: "InterfaceType"
      },
      params: data
    })
  },
  //  选中数据库联动查询数据库版本 //  继续联动查询数据库驱动
  queryInfoByDictId: function (data) {
    return https({
      url: `${WSB_API}/dict/queryInfoByDictId`,
      method: 'get',
      headers: {
        sendKey: "queryInfoByDictId"
      },
      params: data
    })
  },
  //  接口服务元数据注册
  insertInterfaceServer: function (data) {
    return https({
      url: `${JZT_API}/MetaDataRegister/insertInterfaceServer`,
      method: 'post',
      headers: {
        sendKey: "insertInterfaceServer"
      },
      data: data
    })
  },
  //  /MetaDataRegister/findInterfaceServer  查询注册的接口服务
  findInterfaceServer: function (data) {
    return https({
      url: `${JZT_API}/MetaDataRegister/findInterfaceServer`,
      method: 'get',
      headers: {
        sendKey: "findInterfaceServer"
      },
      params: data
    })
  },
  //  接口元数据注册
  insertInterface: function (data) {
    return https({
      url: `${JZT_API}/MetaDataRegister/insertInterface`,
      method: 'post',
      headers: {
        sendKey: "insertInterface"
      },
      data: data
    })
  },
  //    查询注册的接口
  findInterface: function (data) {
    return https({
      url: `${JZT_API}/MetaDataRegister/findInterface`,
      method: 'get',
      headers: {
        sendKey: "findInterface"
      },
      params: data
    })
  },
  //  查询注册的表信息
  findAllTab: function (data) {
    return https({
      url: `${JZT_API}/MetaDataRegister/findAllTab`,
      method: 'get',
      headers: {
        sendKey: "findAllTab"
      },
      params: data
    })
  },
  //  文件服务器元数据注册
  insertFileService: function (data) {
    return https({
      url: `${JZT_API}/MetaDataRegister/insertFileService`,
      method: 'post',
      headers: {
        sendKey: "insertFileService"
      },
      data: data
    })
  },
  //  查询注册的文件服务
  findFileServer: function (data) {
    return https({
      url: `${JZT_API}/MetaDataRegister/findFileServer`,
      method: 'get',
      headers: {
        sendKey: "findFileServer"
      },
      params: data
    })
  },
  //  文件元数据注册
  insertFile: function (data) {
    return https({
      url: `${JZT_API}/MetaDataRegister/insertFile`,
      method: 'post',
      headers: {
        sendKey: "insertFile"
      },
      data: data
    })
  },
  //  查询注册的文件
  findFile: function (data) {
    return https({
      url: `${JZT_API}/MetaDataRegister/findFile`,
      method: 'get',
      headers: {
        sendKey: "findFile"
      },
      params: data
    })
  },
  //  查询系统目录下文件服务器详情信息
  findFileServerBySystemId: function (data) {
    return https({
      url: `${JZT_API}/MetaDataRegister/findFileServerBySystemId`,
      method: 'get',
      headers: {
        sendKey: "findFileServerBySystemId"
      },
      params: data
    })
  },
  // 所属系统联动查询所属接口服务器
  findInterfaceSerBySystemId: function (data) {
    return https({
      url: `${JZT_API}/MetaDataRegister/findInterfaceSerBySystemId`,
      method: 'get',
      headers: {
        sendKey: "findInterfaceSerBySystemId"
      },
      params: data
    })
  }
}



export default metadataRegistrationApi;
